class ALLEVENT {
	//全局通信
	event_func:string[]=[]  
	event_event:string[]=[]
	event_ptr:Object[]=[]
	private static myself:ALLEVENT
	private constructor() {
	}
	public static get getALLEVENTCONTRL():ALLEVENT
	{
        if(this.myself==undefined)this.myself=new ALLEVENT;
		return this.myself
	}
	protected addevent(string:string,func:string,ptr:Object)
	{
       this.event_func.push(func)
	   this.event_event.push(string)
	   this.event_ptr.push(ptr)
	}
	public sendevent(string:string)
	{
       for(let a=0;a<this.event_event.length;a++)
	   {
		   if(this.event_event[a]==string)
		   {
				this.event_ptr[a][this.event_func[a]]();
		   }
		  
	   }
	  
	}
	protected  removeevent(string:string,func:string,ptr:Object)
	{
		for(var a=0;a<this. event_ptr.length;a++)
	   {
		   if(this. event_ptr[a]==ptr)
		   {
				   if(this. event_func[a]==func)
				   {
                          if(this. event_event[a]==string)
						  {
                             this. event_ptr.splice(a,1);
				             this. event_func.splice(a,1);
				             this. event_event.splice(a,1);
						  }
						
		   }
	   }
	}
	}
}